<html>
<head>
<title>RChart, User Guide</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" leftmargin="35">
<h3>RCHART, User Guide</h3>
<p><font face="Arial, Helvetica, sans-serif" size="-1"><i>Copyright 2005, J4L 
  Components (http://www.java4less.com)</i></font> <br>
  <a href="tutorialcontents.html">Go bak to contents</a></p>
<hr>
<h3>Miscelaneous</h3>
<ul>
  <li><font face="Arial, Helvetica, sans-serif" size="-1"><a href="#0">Combined 
    charts (Lines and bars)</a></font></li>
  <li><font face="Arial, Helvetica, sans-serif" size="-1"><a href="#1">Data population 
    (JDBC)</a></font></li>
</ul>
<h4>&nbsp;</h4>
<h4><font face="Arial, Helvetica, sans-serif" size="-1"><a name="0"></a>Combined 
  charts (Lines and bars)</font></h4>
<p><font face="Arial, Helvetica, sans-serif" size="-1">You can easily combine 
  lines and charts by creating 2 series, where one of the serie is a line serie 
  and the other a bars serie:</font></p>
<table width="100%" border="0" height="71">
  <tr> 
    <td width="30%" valign="top" bgcolor="#CCCCCC" height="27"> 
      <div align="center"><font color="#000000"><b><i>Parameters</i></b></font></div>
    </td>
    <td width="26%" valign="top" bgcolor="#CCCCCC" height="27"> 
      <div align="center"><font color="#000000"><b><i>Description</i></b></font></div>
    </td>
    <td width="44%" valign="top" bgcolor="#CCCCCC" height="27"> 
      <div align="center"><font color="#000000"><b><i>Equivalent java class/property</i></b></font></div>
    </td>
  </tr>
  <tr> 
    <td width="30%" valign="top" height="189"> 
      <p>SERIE_1=Products<br>
        SERIE_2=Services <br>
        SERIE_TYPE_1=BAR <br>
        SERIE_TYPE_2=LINE<br>
        SERIE_DATA_1=30|30|34|23|40<br>
        SERIE_DATA_2=83|70|95|70|52 <br>
        SERIE_DATAX_2=1|2|3|4|5|6|7 </p>
    </td>
    <td width="26%" valign="top" height="189"> 
      <p><font color="#3333FF">Definition of the scale<br>
        <br>
        First serie, bars (in the background)<br>
        Second serie, line (in the foreground)<br>
        Bars values<br>
        Line values<br>
        Make the like start at tick 1 to that it is aligned with the bars</font></p>
    </td>
    <td width="44%" valign="top" height="189"> 
      <div align="left"> 
        <p>linePlotter=new LinePlotter();<br>
          barPlotter=new BarPlotter(); <br>
          <br>
          <br>
          <br>
          serie1=new BarDataSerie(values1,fillStyle);<br>
          serie2=new LineDataSerie(values2,lineStyle); <br>
          <br>
          chart=new Chart(cTitle,barPlotter,cXAxis,cYAxis);<br>
          chart.addPlotter(linePlot); </p>
      </div>
    </td>
  </tr>
</table>
<p><font face="Arial, Helvetica, sans-serif" size="-1"><img src="images/combined.png"></font></p>
<h4>&nbsp;</h4>
<h4><font face="Arial, Helvetica, sans-serif" size="-1"><a name="1"></a>Data population 
  (JDBC)</font></h4>
<p><font face="Arial, Helvetica, sans-serif" size="-1">If you use the ChartLoader 
  to creare charts you can use the jdbc facilities in order to read data from 
  a database. First of all you must specify how to connect to the database using 
  the following parameters:</font></p>
<ul>
  <li><font face="Arial, Helvetica, sans-serif" size="-1">JDBC_DATABASE. Database 
    to connect to. For example: jdbc:odbc:ODBCNAME. If you want to use a jdbc 
    native driver please check your driver's documentation to learn the format 
    of the connection string. </font></li>
  <li><font face="Arial, Helvetica, sans-serif" size="-1">JDBC_DRIVER. Jdbc driver, 
    if empty, the odbc bridge will be used. </font></li>
  <li><font face="Arial, Helvetica, sans-serif" size="-1">JDBC_USER. </font></li>
  <li><font face="Arial, Helvetica, sans-serif" size="-1">JDBC_PASSWORD.</font></li>
</ul>
<p><font face="Arial, Helvetica, sans-serif" size="-1"><br>
  when RChart is connected to your database you can put a SQL Select command in 
  any RChart parameter. SQL Queries must have the &quot;JDBC:&quot; prefix. For 
  example:</font></p>
<p><font face="Arial, Helvetica, sans-serif" size="-1">SERIE_DATA_1=JDBC:Select 
  soldQty from SalesMonth Order by salesMonth DESC</font></p>
<p><font face="Arial, Helvetica, sans-serif" size="-1">note that RChart will only 
  read the first field in the select statement, for this reason it is useless 
  to use more than 1 field in the query. If the query returns more than 1 record, 
  RChart will return the values as a list separated by | , just like parameters 
  are expected.</font></p>
<p><font face="Arial, Helvetica, sans-serif" size="-1">The SQL queries you define 
  in RChart can also contain parameters. For example:</font></p>
<p><font face="Arial, Helvetica, sans-serif" size="-1">SERIE_DATA_1=JDBC:Select 
  soldQty from SalesMonth where ProductId='[%product]' Order by salesMonth DESC</font></p>
<p><font face="Arial, Helvetica, sans-serif" size="-1">This query contains a parameter 
  called &quot;product&quot;. Before you try to create a chart containing this 
  query you must provide a value for all parameters. This is done in the following 
  java code:</font></p>
<p><font face="Arial, Helvetica, sans-serif" size="-1">chartLoader.setSQLParameter(&quot;product&quot;,&quot;1&quot;);</font></p>
<p><font face="Arial, Helvetica, sans-serif" size="-1">where the first parameter 
  of setSQLParameter is the parameter name and the second is the value.</font></p>
<p> </p>
<p></p>
<p>&nbsp;</p>
<hr>
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>
